package com.eascs.fp.article.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.dubbo.config.annotation.Reference;
import com.eascs.app.dao.PageResult;
import com.eascs.finance.admin.common.entity.ArticleEntity;
import com.eascs.finance.admin.common.entity.ArticleItemEntity;
import com.eascs.finance.admin.common.service.IArticlefoService;
import com.eascs.finance.admin.common.vo.ArticleQueryVO;
import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.HtmlRestResult;
import com.eascs.site.view.ViewContext;

@Controller
@RequestMapping(value="/rArticle")
public class ArticleShowRestController extends BaseRestController {
	@Reference
	IArticlefoService articlefoService;
	
	@RequestMapping(value="/showCatalog")
	public HtmlRestResult getTitles(ArticleQueryVO vo) {
		PageResult<ArticleEntity> frontArticleInfo = null;
		try {
			frontArticleInfo = articlefoService.findFrontArticleInfo(vo);
			ArticleItemEntity item = new ArticleItemEntity();
			item.setId(vo.getItemId());
			ViewContext.put("item", item);
			ViewContext.put("ArticlesInfo", frontArticleInfo);
		} catch (Exception e) {} 
		return HtmlRestResult.html("/article/titlePagination");
		
	}
	
}
